package com.wsc.repository;



import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.wsc.entity.Student;


public interface SwipingCardRepository extends JpaRepository<Student, Integer>{
	
	@Modifying
	@Query(value="update t_students s set s.status = :status where s.cardno = :cardno",nativeQuery=true)
	Integer swipingCard(@Param("cardno")String cardno, @Param("status")Integer status);
	
	
	@Modifying
	@Query(value="update t_students s set s.status = :out where s.cardno = :cardno",nativeQuery=true)
	void OutSwipingCard(@Param("cardno")String cardno,@Param("out")Integer out);
	

	/*
	 * @Modifying
	 * 
	 * @Query(value="select * from t_students s where s.cardno = :cardno"
	 * ,nativeQuery=true) List<Student> getAllByCardno(@Param("cardno")String
	 * cardno);
	 */
	
	


}
